package com.didispace.web;

import com.didispace.service.StoreIntegration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ComputeController {

    private static Logger log = LoggerFactory.getLogger(ComputeController.class);

//    @Autowired
//    private DiscoveryClient client;

    @Autowired
    private StoreIntegration storeIntegration;


    @RequestMapping(value = "/add" ,method = RequestMethod.GET)
    public String add() {
//        ServiceInstance instance = client.getLocalServiceInstance();
//        Integer r = a + b;
//        log.info("/add, host:" + instance.getHost() + ", service_id:" + instance.getServiceId() + ", result:" + r);

//        String message  = storeIntegration.defaultStores(null);
//        log.info("/echo:" + message);

        return storeIntegration.getStores();
    }
}